@extends('admin.index')
@section('css')
    <link rel="stylesheet" href="{{ asset('admins/css/pintuer.css') }}">
    <link rel="stylesheet" href="{{ asset('admins/css/admin.css') }}">
@stop
@section('content')
<form action="" name="myform" method='post'>
    <input type="hidden" name="_method" value="DELETE">
    <input type="hidden" name="_token" value="{{csrf_token()}}">
</form>
<div class="panel admin-panel">
  <div class="panel-head"><strong class="icon-reorder"> 内容列表</strong></div>
  <div class="padding border-bottom">  
  <button type="button" class="button border-yellow" onclick="window.location.href='#add'"><span class="icon-plus-square-o"></span> 添加内容</button>
  </div>
  <table class="table table-hover text-center">
    <tr>
      <th width="10%">ID</th>
      <th width="20%">图片</th>
      <th width="15%">名称</th>
      <th width="15%">状态</th>
      <th width="15%">操作</th>
    </tr>
   @foreach($list as $k=>$v)
    <tr>
      <td>{{$v->id}}</td>     
      <td><img src="{{ asset('./uploads/').'/'.$v->photo}}" alt="" width="120" height="50" /></td>     
      <td>{{$v->name}}</td>
      <td>{{$v->status==0?'显示':'隐藏'}}</td>
      <td><div class="button-group">
      <a class="button border-main" href="/admin/info/{{$v->id}}/edit"><span class="icon-edit"></span> 修改</a>
      <a class="button border-red" href="javascript:del({{$v->id}})"><span class="icon-trash-o"></span> 删除</a>
      </div></td>
    </tr>
    @endforeach
    
    
  </table>
</div>
<script type="text/javascript">
function del(id){
   if(confirm("你确定要删除吗？")){
      var form = document.myform;
      form.action = '/admin/info/'+id;
      form.submit();
  }
}
</script>
@section('js')
    <script src="{{ asset('admins/js/jquery.js') }}"></script>
    <script src="{{ asset('admins/js/pintuer.js') }}"></script>  
@stop
@stop